// GNEncode.h: interface for the GNEncode class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_GNENCODE_H__9CA319B2_99C2_4391_9A43_ECB36C94150A__INCLUDED_)
#define AFX_GNENCODE_H__9CA319B2_99C2_4391_9A43_ECB36C94150A__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "BlowFish.h"
#include "StringUtil.h"
#include "WStringUtil.h"

class GNEncode  
{
public:
	GNEncode(unsigned char *pucKey, int iLen);
	virtual ~GNEncode();

	void EncodeString(gnstring &s);
	void DecodeString(gnstring &s);
	void WEncodeString(wstring &s);
	void WDecodeString(wstring &s);

private:
	void _EncodeOrDecodeString(gnstring &s, bool bEncode);
	void _WEncodeOrDecodeString(wstring &s, bool bEncode);

	CBlowFish		m_cEncode;
};

#endif // !defined(AFX_GNENCODE_H__9CA319B2_99C2_4391_9A43_ECB36C94150A__INCLUDED_)
